﻿angular.module('resources.invoiceProxy', []);
angular.module('resources.invoiceProxy').factory('invoiceProxy', ['rresource', function (rresource) {
    var factory = rresource('invoice');

    factory.invoicePaging = function (index, itemCount, filter, successcb, failedcb) {
        var itemspage = (index - 1) * itemCount;
        var filterStr = "$top=" + itemCount + "&$skip=" + itemspage + filter + "&$count=true";
        return factory.odataQuery(filterStr, successcb, failedcb);

    };

    factory.invoiceUnPaging = function (filter, successcb, failedcb) {
        return factory.odataQuery(filter, successcb, failedcb);

    };

    factory.invoicePagingCount = function (filter, successcb, failedcb) {

        var filterStr = filter;
        return factory.odataQuery(filterStr, successcb, failedcb);
    };


    return factory;
} ]);
